let config = require('../utils/config')
module.exports = async (ctx, next) => {
      ctx.params = {
        ...ctx.request.body,
        ...ctx.query
      };

      for(let key in ctx.params) {
        if (ctx.params[key] === 'true') {
          ctx.params[key] = true;
        } else if(ctx.params[key] === 'false') {
          ctx.params[key] = false;
        }
      } 
      ctx.baseURL= process.env.dbpath;
      // let {port=7000,host='http://106.55.50.108'} = ctx.params;  
      // ctx.baseURL= host+':'+port;
      // delete ctx.params.port;
      // delete ctx.params.host;
      await next();
  };
  